home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / buttons / eztips / main.frm next >
Text File  |  1995-10-09  |  6KB  |  191 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Easy Tooltips"
  6.    ClientHeight    =   3435
  7.    ClientLeft      =   2430
  8.    ClientTop       =   2130
  9.    ClientWidth     =   5265
  10.    ForeColor       =   &H00000000&
  11.    Height          =   3840
  12.    Left            =   2370
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3435
  17.    ScaleWidth      =   5265
  18.    Top             =   1785
  19.    Width           =   5385
  20.    Begin Timer Timer1 
  21.       Interval        =   1000
  22.       Left            =   150
  23.       Top             =   3630
  24.    End
  25.    Begin PictureBox ToolTip_Picture 
  26.       AutoSize        =   -1  'True
  27.       BorderStyle     =   0  'None
  28.       Height          =   330
  29.       Left            =   60
  30.       Picture         =   MAIN.FRX:0000
  31.       ScaleHeight     =   330
  32.       ScaleWidth      =   360
  33.       TabIndex        =   2
  34.       Top             =   30
  35.       Width           =   360
  36.    End
  37.    Begin CommandButton ToolTip_CmdBtn 
  38.       Caption         =   "E&xit"
  39.       FontBold        =   0   'False
  40.       FontItalic      =   0   'False
  41.       FontName        =   "Arial"
  42.       FontSize        =   8.25
  43.       FontStrikethru  =   0   'False
  44.       FontUnderline   =   0   'False
  45.       Height          =   330
  46.       Left            =   4710
  47.       TabIndex        =   0
  48.       Top             =   30
  49.       Width           =   495
  50.    End
  51.    Begin Label ForGround_Label 
  52.       BackStyle       =   0  'Transparent
  53.       Caption         =   "Easy Tooltips"
  54.       FontBold        =   -1  'True
  55.       FontItalic      =   0   'False
  56.       FontName        =   "Times New Roman"
  57.       FontSize        =   22.5
  58.       FontStrikethru  =   0   'False
  59.       FontUnderline   =   0   'False
  60.       Height          =   585
  61.       Left            =   1380
  62.       TabIndex        =   4
  63.       Top             =   1350
  64.       Width           =   2685
  65.    End
  66.    Begin Label BackGround_Label 
  67.       BackColor       =   &H00C0C0C0&
  68.       BackStyle       =   0  'Transparent
  69.       Caption         =   "Easy Tooltips"
  70.       FontBold        =   -1  'True
  71.       FontItalic      =   0   'False
  72.       FontName        =   "Times New Roman"
  73.       FontSize        =   22.5
  74.       FontStrikethru  =   0   'False
  75.       FontUnderline   =   0   'False
  76.       ForeColor       =   &H00808080&
  77.       Height          =   615
  78.       Left            =   1350
  79.       TabIndex        =   3
  80.       Top             =   1410
  81.       Width           =   2715
  82.    End
  83.    Begin Image Tooltips_Image1 
  84.       Height          =   480
  85.       Left            =   180
  86.       Picture         =   MAIN.FRX:0182
  87.       Top             =   750
  88.       Width           =   480
  89.    End
  90.    Begin Line Line2 
  91.       BorderColor     =   &H00FFFFFF&
  92.       X1              =   0
  93.       X2              =   6450
  94.       Y1              =   420
  95.       Y2              =   420
  96.    End
  97.    Begin Line Line1 
  98.       BorderColor     =   &H00808080&
  99.       X1              =   0
  100.       X2              =   6450
  101.       Y1              =   390
  102.       Y2              =   390
  103.    End
  104.    Begin Label Tooltips 
  105.       BackColor       =   &H00FFFF80&
  106.       ForeColor       =   &H00000000&
  107.       Height          =   225
  108.       Left            =   3990
  109.       TabIndex        =   1
  110.       Top             =   3630
  111.       Width           =   1155
  112.    End
  113. End
  114. '====================================
  115. '// File Name:TOOLTIPS.MAK
  116. '//
  117. '// Description: This example shows how to implement "ToolTips" help
  118. '// in a Visual Basic application. VB code, no Windows API functions
  119. '// or VBX.
  120. '//
  121. '// Copyright: Freeware!!! (Use at your own risk)
  122. '// Any questions, please contact me at 73123,1700
  123. '// Revision History:
  124. '//
  125. '// ====================================
  126.  
  127. Option Explicit ' Force variable declaration.
  128. Dim Control_Name$   ' Declare variables.
  129.  
  130.  
  131. Sub ForGround_Label_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  132.     Control_Name$ = "ForGround_Label"
  133. End Sub
  134.  
  135. Sub Form_Load ()
  136.     ' The form is horizontally and vertically centered when loaded.
  137.     Top = Screen.Height / 2 - Height / 2
  138.     Left = Screen.Width / 2 - Width / 2
  139.     'Define Tooltips properties
  140.     Tooltips.BackColor = &HE0FFFF
  141.     Tooltips.AutoSize = True
  142.     Tooltips.BorderStyle = 1
  143.     Tooltips.Visible = False
  144. End Sub
  145.  
  146. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  147.     Control_Name$ = ""
  148.     Tooltips.Visible = False
  149. End Sub
  150.  
  151. Sub Timer1_Timer ()
  152.     Select Case Control_Name$
  153.         Case "ToolTip_Picture"
  154.             Tooltips.Caption = " Tooltips Below Right "
  155.             Tooltips.Move ToolTip_Picture.Left + 50, ToolTip_Picture.Top + (ToolTip_Picture.Height + 100)
  156.             Tooltips.Visible = True
  157.             Case "ToolTip_CmdBtn"
  158.             Tooltips.Caption = " Tooltips Below Left "
  159.             Tooltips.Move (ToolTip_CmdBtn.Left - (Len(Tooltips.Caption) * 80)), ToolTip_CmdBtn.Top + (ToolTip_CmdBtn.Height + 100)
  160.             Tooltips.Visible = True
  161.         Case "Tooltips_Image1"
  162.             Tooltips.Caption = " Tooltips Center Right "
  163.             Tooltips.Move Tooltips_Image1.Left + Tooltips_Image1.Width + 50, Tooltips_Image1.Top - ((Tooltips_Image1.Height / 2) - (Tooltips_Image1.Height) + 100)
  164.             Tooltips.Visible = True
  165.         Case "ForGround_Label"
  166.             Tooltips.Caption = " Tooltips Above Left "
  167.             Tooltips.Visible = True
  168.             Tooltips.Move ForGround_Label.Left + 50, ForGround_Label.Top - Tooltips.Height
  169.         Case Else
  170.             Tooltips.Visible = False
  171.     End Select
  172.     Control_Name$ = ""
  173. End Sub
  174.  
  175. Sub ToolTip_CmdBtn_Click ()
  176.     Unload Me
  177. End Sub
  178.  
  179. Sub ToolTip_CmdBtn_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  180.     Control_Name$ = "ToolTip_CmdBtn"
  181. End Sub
  182.  
  183. Sub ToolTip_Picture_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  184.     Control_Name$ = "ToolTip_Picture"
  185. End Sub
  186.  
  187. Sub Tooltips_Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  188.     Control_Name$ = "Tooltips_Image1"
  189. End Sub
  190.  
  191.